<?php
/*
Template Name: Ajax
*/
	$action = $_REQUEST['action'];
	if($action == null)
		die();
	if($action == 'sign_up') {
		$email = $_POST['join_email'];
		if($email == null || empty($email))
			die("FAIL");
		$admin_email = get_settings('admin_email');
		$content = "Email sign up for mailing list : $email";
		if(empty($subject))
			$subject = 'Email sign up for mailing list!';
		$headers  = 'MIME-Version: 1.0' . "\r\n";
		$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
		// Additional headers
		$headers .= "To: $admin_email" . "\r\n";
		if($from != null)
			$headers .= "From: $contacter" . "\r\n";
		if(wp_mail( $admin_email, $subject, $content, $headers, null )==false)
			echo "FAIL";
		else
			echo "DONE";
	}

?>